feat: support for graceful shutdown based on configuration#2479
Conversation
| .withReconciliationTerminationTimeout(Duration.ofSeconds(5)); | ||
|
|
||
| final var operator = new Operator(overridden); | ||
| ``` |
There was a problem hiding this comment.
In my opinion, it is beneficial for users to be aware of this feature, so I have documented it.
However, in most users' cases, the graceful shutdown feature may not be necessary.
If you think this documentation is unnecessary, please let me know and I will remove it.
| * @return The duration of time to wait before terminating the reconciliation threads | ||
| */ | ||
| default Duration reconciliationTerminationTimeout() { | ||
| return Duration.ZERO; |
There was a problem hiding this comment.
The default is immediate shutdown
| .build(); | ||
|
|
||
| @Test | ||
| void stopsGracefullyWIthTimeout() { |
There was a problem hiding this comment.
I also corrected a typo in the method name while I was at it.
| LocallyRunOperatorExtension operator = | ||
| LocallyRunOperatorExtension.builder() | ||
| .withConfigurationService(o -> o.withCloseClientOnStop(false) | ||
| .withReconciliationTerminationTimeout(Duration.ofSeconds(RECONCILER_SLEEP))) |
There was a problem hiding this comment.
.withReconciliationTerminationTimeout(Duration.ofMillis(RECONCILER_SLEEP)))
User can configure the graceful shutdown time in the Operator settings.
Support for graceful shutdown based on configuration Signed-off-by: 10000-ki <10000ki6472@gmail.com> Fix naming Signed-off-by: 10000-ki <10000ki6472@gmail.com> Fix lint error Signed-off-by: 10000-ki <10000ki6472@gmail.com> Fix lint error Signed-off-by: 10000-ki <10000ki6472@gmail.com> Fix lint error Signed-off-by: 10000-ki <10000ki6472@gmail.com> Fix test duration Signed-off-by: 10000-ki <10000ki6472@gmail.com>
@csviri Configuration-based graceful shutdown can be difficult to modify at runtime, so supporting features like However, from an actual user's perspective, it doesn't seem very beneficial. It might be clearer to specify the graceful shutdown timeout value when setting up the Operator Configuration Personally, I think it's fine to no longer support it, but there may be users using it in previous versions. Therefore, I didn't make any changes to it in this PR. Should we mark it as deprecated?? |
Signed-off-by: 10000-ki <10000ki6472@gmail.com>
Signed-off-by: 10000-ki <10000ki6472@gmail.com>
Signed-off-by: 10000-ki <10000ki6472@gmail.com>
|
Thank you! |
|
Awesome, thank you! |
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
--------- Signed-off-by: 10000-ki <10000ki6472@gmail.com>
resolved: #2476
What i am working on in this PR
stopmethod.